package com.agua.enturno.vista.dto.assemblers;

import com.agua.enturno.excepciones.ExcepcionDeReglaDelNegocio;

public abstract class NullAwareSimpleAssembler<T, TDTO> {

	
	public TDTO assemble(T type) {
		return type == null ? null : internalAssemble(type);
	}
	
	public T disassemble(TDTO dtoType) throws ExcepcionDeReglaDelNegocio {
		return dtoType == null ? null : internalDisassemble(dtoType);
	}
	
	protected abstract TDTO internalAssemble(T type);
	protected abstract T internalDisassemble(TDTO dtoType) throws ExcepcionDeReglaDelNegocio;
	
}
